<template>
<header>
  <div class="l-content">
    <el-button @click="changeStatus" plain icon="el-icon-menu" size="mini"></el-button>
    <!-- <h4 style="color:#fff">首页</h4> -->
    <el-breadcrumb separator="/">
      <el-breadcrumb-item  v-for=" item in tags" :key="item.path" :to="{ path: item.path }">{{item.label}}</el-breadcrumb-item>
    </el-breadcrumb>
  </div>
  <div class="r-content">
    <el-dropdown triggle="click" size="mini">
      <span>
        <img class="user" :src="userImg">
      </span>
      <el-dropdown-menu slot="dropdown">
        <el-dropdown-item>个人中心</el-dropdown-item>
        <el-dropdown-item>退出</el-dropdown-item>
      </el-dropdown-menu>
    </el-dropdown>
  </div>
</header>
</template>

<script>
import { mapState } from 'vuex'
import store from '../store'



export default {
  name:'CommonHeader',
  data(){
    return{
      userImg:require('../assets/images/user.png')
    }
  },
  methods: {
    changeStatus(){
      this.$store.state.tab.isCollapse = !this.$store.state.tab.isCollapse;
    }
  },
  computed:{
    ...mapState({
      tags:state=>state.tab.tabsList
    })

  }
}
</script>

<style lang="less" scoped>
header {
  display: flex;
  height: 100%;
  justify-content: space-between;
  align-items: center;
}
.l-content {
  display: flex;
  align-items: center;
  .el-button {
    margin-right: 10px;
  }
}
.r-content {
  .user {
    widows: 40px;
    height: 40px;
    border-radius: 50%;
  }
}

</style>